package com.shanling.shanlingcontroller.ui.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.shanling.shanlingcontroller.R;

public class GuideFragment extends Fragment {
    public static GuideFragment buildGuideFragment(int index) {
        GuideFragment guideFragment = new GuideFragment();
        Bundle args = new Bundle();
        args.putInt("PAGE", index);
        guideFragment.setArguments(args);
        return guideFragment;
    }
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        if (getContentViewLayoutID() != 0) {
            return inflater.inflate(getContentViewLayoutID(), null);
        } else {
            return super.onCreateView(inflater, container, savedInstanceState);
        }
    }

    protected int getContentViewLayoutID() {
        int pageIndex = getArguments().getInt("PAGE", 0);
        int layoutId= R.layout.frag_add_guide_pager1_tw;
        switch (pageIndex) {
            case 0:
                layoutId= R.layout.frag_add_guide_pager1_tw;
                break;
            case 1:
                layoutId= R.layout.frag_add_guide_pager1_tw;
                break;
            case 2:
                layoutId=R.layout.frag_add_guide_pager1_tw;
                break;
        }
        return layoutId;
    }
}
